package host.skiree.nettydemo.client.service;

import host.skiree.nettydemo.client.service.impl.*;
import host.skiree.nettydemo.message.Message;

import java.util.HashMap;
import java.util.Map;

/**
 * @author gcl
 * @date 2022/9/19 8:44
 */
public class MessageClientHandlerFactory {

    /**
     * 存储策略handler容器
     */
    public static final Map<Integer, MessageClientHandler> MESSAGE_HANDLER = new HashMap<>();

    static {
        MESSAGE_HANDLER.put(Message.LoginResponseMessage, new Login());
        MESSAGE_HANDLER.put(Message.ChatResponseMessage, new Chat());
        MESSAGE_HANDLER.put(Message.UserListResponseMessage, new UserList());
        MESSAGE_HANDLER.put(Message.GroupCreateResponseMessage, new GroupCreate());
        MESSAGE_HANDLER.put(Message.GroupListResponseMessage, new GroupList());
        MESSAGE_HANDLER.put(Message.GroupChatResponseMessage, new GroupChat());
        MESSAGE_HANDLER.put(Message.GroupMembersResponseMessage, new GroupMembers());
        MESSAGE_HANDLER.put(Message.GroupJoinResponseMessage, new GroupJoin());
        MESSAGE_HANDLER.put(Message.GroupQuitResponseMessage, new GroupQuit());
    }

}
